
 /**
 * COOKIE存储
 * @param {String} key 键
 * @param {Object} val 值
 * @param {Number} time 时间
 */
 function setcookie(key,value,time){
    
    const d = new Date
    d.setTime(d.getTime()-1000*60*60*8 + 1000*time)
    document.cookie = key+'='+value+';expires='+d;
 }

   /**
 * COOKIE获取
 * @param {String} key 键
 * @return string
 */
 function getcookie(key){
    let arr = document.cookie.split('; ');
 for(let i = 0;i<arr.length;i++){
    let arr1 = arr[i].split('=');
    if(arr1[0]==key) return arr1[1];
 }
 return ''
 }


  /**
 * COOKIE删除
 * @param {String} key 键
 * @return undefined
 */
function removecookie(key){
    setcookie(key,null,-1)
}
